package diagonalSum;

public class Solution {
    public int diagonalSum(int[][] mat) {
        for (int i = 1,j = 1; i < mat.length; i++,j++) {
            mat[0][0]+=mat[i][j];
        }
        for (int i = 0,j = mat.length-1; i < mat.length ; i++,j--) {
            if(i!=j){
                mat[0][0]+=mat[i][j];
            }
        }
        return mat[0][0];
    }
}
